Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make which quantities are sampled more readily configurable #326

Merged
merged 37 commits into from
Feb 13, 2025

Conversation

dylanhmorris
Copy link
Contributor

@dylanhmorris dylanhmorris commented Feb 5, 2025

This PR creates a clearer interface for configuring what quantities are sampled during fitting and posterior prediction. This will make it easier to use the same infrastructure for the various Pyrenew-{H,E,W} combinations.

To do:

  • Unit tests to confirm that configuration of what is sampled works as expected
  • Fix end to end test
  • Test fit/forecast flag combinations.

Copy link

codecov bot commented Feb 5, 2025

Codecov Report

Attention: Patch coverage is 75.00000% with 16 lines in your changes missing coverage. Please review.

Project coverage is 26.86%. Comparing base (5bd8178) to head (58dfda3).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pipelines/forecast_state.py 0.00% 14 Missing ⚠️
pipelines/fit_pyrenew_model.py 0.00% 1 Missing ⚠️
pipelines/generate_predictive.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #326      +/-   ##
==========================================
+ Coverage   23.15%   26.86%   +3.70%     
==========================================
  Files          22       24       +2     
  Lines        1710     1768      +58     
==========================================
+ Hits          396      475      +79     
+ Misses       1314     1293      -21     
Flag Coverage Δ
hewr 35.35% <ø> (ø)
pipelines 14.83% <65.21%> (+9.83%) ⬆️
pyrenew_hew 30.37% <100.00%> (+2.40%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dylanhmorris dylanhmorris marked this pull request as ready for review February 6, 2025 00:47
Copy link
Collaborator

@damonbayer damonbayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about an approach that parsed the model name? We already use model_name as an argument to many functions in the pipeline.

@damonbayer
Copy link
Collaborator

What do you think about an approach that parsed the model name? We already use model_name as an argument to many functions in the pipeline.

Per F2F discussion, the model name approach will not be taken in this PR. In the future, we could implement is and make use of the switches approach implemented in this PR.

@dylanhmorris
Copy link
Contributor Author

Per F2F discussion, the model name approach will not be taken in this PR. In the future, we could implement is and make use of the switches approach implemented in this PR.

Update: I think it's fairly straightforward and arguably more robust to name the model based on the values of the switches, which I've done here:

pyrenew_model_name = pyrenew_model_name_from_flags(
fit_ed_visits=fit_ed_visits,
fit_hospital_admissions=fit_hospital_admissions,
fit_wastewater=fit_wastewater,
)

pyrenew_hew/util.py Outdated Show resolved Hide resolved
pyrenew_hew/util.py Outdated Show resolved Hide resolved
pyrenew_hew/util.py Outdated Show resolved Hide resolved
@dylanhmorris dylanhmorris requested review from damonbayer and removed request for damonbayer February 13, 2025 01:40
Copy link
Collaborator

@damonbayer damonbayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @dylanhmorris!

@dylanhmorris dylanhmorris enabled auto-merge (squash) February 13, 2025 22:06
@dylanhmorris dylanhmorris merged commit 026f1eb into main Feb 13, 2025
15 checks passed
@dylanhmorris dylanhmorris deleted the dhm-configure-which-fit branch February 13, 2025 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants